Skip to content

Allow 2.0 tutorials to use mermaid diagrams#1171

Merged
ksen0 merged 1 commit intoprocessing:2.0from
nbogie:nb-fix-1066-allow-mermaid-diagrams-in-tutorials
Feb 24, 2026
Merged

Allow 2.0 tutorials to use mermaid diagrams#1171
ksen0 merged 1 commit intoprocessing:2.0from
nbogie:nb-fix-1066-allow-mermaid-diagrams-in-tutorials

Conversation

@nbogie
Copy link
Copy Markdown
Contributor

@nbogie nbogie commented Feb 14, 2026

Changes:

  1. Change TutorialLayout (src/layouts/TutorialLayout.astro)
  2. Add PreProxy src/components/PreProxy/index.astro

In TutorialLayout, send pre blocks to a new PreProxy which only calls CodeBlockWrapper if the block is not tagged mermaid. Otherwise it leaves them untouched so that mermaid can interpret and convert correctly.

Prevents blocks such as the following being sent to CodeBlockWrapper:

```mermaid
//diagram here
```

Fixes #1066 for 2.0
(This is just a cherry-pick of previous fix for main branch / p5 v1.x.)

@ksen0 ksen0 merged commit 10621a2 into processing:2.0 Feb 24, 2026
4 checks passed
@nbogie nbogie deleted the nb-fix-1066-allow-mermaid-diagrams-in-tutorials branch February 24, 2026 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants